<?php
/**
 * "Visual Paradigm: DO NOT MODIFY THIS FILE!"
 * 
 * This is an automatic generated file. It will be regenerated every time 
 * you generate persistence class.
 * 
 * Modifying its content may cause the program not work, or your work may lost.
 */

/**
 * Licensee: DuKe TeAm
 * License Type: Purchased
 */

class Products extends Doctrine_Record {
  public function setTableDefinition() {
    $this->setTableName('products');
    $this->hasColumn('pro_id', 'integer', 4, array(
        'type' => 'integer',
        'length' => 4,
        'unsigned' => false,
        'notnull' => true,
        'primary' => true, 
        'autoincrement' => true,
      )
    );
    $this->hasColumn('pro_code', 'string', 255, array(
        'type' => 'string',
        'length' => 255,
        'fixed' => false,
        'notnull' => true,
      )
    );
    $this->hasColumn('pro_name', 'string', 255, array(
        'type' => 'string',
        'length' => 255,
        'fixed' => false,
        'notnull' => true,
      )
    );
    $this->hasColumn('pro_price', 'float', array(
        'type' => 'float',
        'notnull' => true,
      )
    );
    $this->hasColumn('pro_status', 'integer', 4, array(
        'type' => 'integer',
        'length' => 4,
        'unsigned' => false,
        'notnull' => true,
      )
    );
    $this->hasColumn('pro_createtime', 'timestamp', 0, array(
        'type' => 'timestamp',
        'length' => 0,
        'notnull' => true,
      )
    );
    $this->hasColumn('pro_updatetime', 'timestamp', 0, array(
        'type' => 'timestamp',
        'length' => 0,
        'notnull' => true,
      )
    );
    $this->hasColumn('art_id', 'integer', 4, array(
        'type' => 'integer',
        'length' => 4,
        'unsigned' => false,
        'notnull' => true,
      )
    );
  }
  
  public function setUp() {
    parent::setUp();
    $this->hasOne('Articles as art', array(
        'local' => 'art_id', 
        'foreign' => 'art_id'
      )
    );
    $this->hasMany('Promotions as promotions', array(
        'local' => 'pro_id', 
        'foreign' => 'product_id'
      )
    );
    $this->hasMany('Tax as tax', array(
        'local' => 'pro_id', 
        'foreign' => 'pro_id'
      )
    );
    $this->hasMany('Checkout_detail as checkout_detail', array(
        'local' => 'pro_id', 
        'foreign' => 'pro_id'
      )
    );
    $this->hasMany('Product_properties as product_properties', array(
        'local' => 'pro_id', 
        'foreign' => 'productspro_id'
      )
    );
  }
  
}

?>
